package com.lw.chat.view.main;

import de.saxsys.mvvmfx.SceneLifecycle;
import de.saxsys.mvvmfx.ViewModel;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;


public class MainViewModel implements ViewModel, SceneLifecycle {
    private SimpleBooleanProperty maximized = new SimpleBooleanProperty(false);

    private StringProperty title = new SimpleStringProperty(System.getProperty("app.name"));


    public void initialize() {

    }

    public String getTitle() {
        return title.get();
    }

    public StringProperty titleProperty() {
        return title;
    }

    public void setTitle(String title) {
        this.title.set(title);
    }


    /**
     * 在视图中添加
     */
    @Override
    public void onViewAdded() {


    }

    /**
     * 在视图中删除
     */
    @Override
    public void onViewRemoved() {
        System.err.println("------remove");
    }


    public boolean isMaximized() {
        return maximized.get();
    }

    public SimpleBooleanProperty maximizedProperty() {
        return maximized;
    }

    public void setMaximized(boolean maximized) {
        this.maximized.set(maximized);
    }


}
